<?php

namespace GamesBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @author  coffey  <coffey@nligo.com>
 * UserProfile
 *
 * 用户资料表
 *
 * @ORM\Table(name="user_profile")
 * @ORM\Entity(repositoryClass="GamesBundle\Repository\UserProfileRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class UserProfile
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false,options={"comment":"资料自增ID"})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * 一份资料一个用户
     * @ORM\OneToOne(targetEntity="User", inversedBy="profile")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     */
    private $userId;

    /**
     * @var string
     *
     * @ORM\Column(name="phone_num", type="string", length=120, nullable=false,options={"comment":"手机号码"})
     */
    private $phoneNum = '';

    /**
     * @var string
     *
     * @ORM\Column(name="wechat_num", type="string", length=120, nullable=false,options={"comment":"微信号"})
     */
    private $wechatNum = '';

    /**
     * @var string
     *
     * @ORM\Column(name="alipay_num", type="string", length=120, nullable=false,options={"comment":"支付宝号码"})
     */
    private $alipayNum = '';

    /**
     * @var string
     *
     * @ORM\Column(name="bank_num", type="string", length=120, nullable=false,options={"comment":"银行卡号"})
     */
    private $bankNum = '';

    /**
     * @var string
     *
     * @ORM\Column(name="qq_num", type="string", length=120, nullable=false,options={"comment":"qq号码"})
     */
    private $qqNum = '';

    /**
     * @var integer
     *
     * @ORM\Column(name="create_at", type="integer", nullable=false,options={"comment":"创建时间"})
     */
    private $createAt = '0';

    /**
     * @var integer
     *
     * @ORM\Column(name="update_at", type="integer", nullable=false,options={"comment":"更新时间"})
     */
    private $updateAt = '0';


    /**
     * @ORM\PrePersist
     */
    public function PrePersist(){
        $this->setCreateAt(time());
        $this->setUpdateAt(time());
    }

    /**
     * @ORM\PreUpdate
     */
    public function PreUpdate(){
        $this->setCreateAt(time());
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set wechatNum
     *
     * @param string $wechatNum
     *
     * @return UserProfile
     */
    public function setWechatNum($wechatNum)
    {
        $this->wechatNum = $wechatNum;

        return $this;
    }

    /**
     * Get wechatNum
     *
     * @return string
     */
    public function getWechatNum()
    {
        return $this->wechatNum;
    }

    /**
     * Set alipayNum
     *
     * @param string $alipayNum
     *
     * @return UserProfile
     */
    public function setAlipayNum($alipayNum)
    {
        $this->alipayNum = $alipayNum;

        return $this;
    }

    /**
     * Get alipayNum
     *
     * @return string
     */
    public function getAlipayNum()
    {
        return $this->alipayNum;
    }

    /**
     * Set bankNum
     *
     * @param string $bankNum
     *
     * @return UserProfile
     */
    public function setBankNum($bankNum)
    {
        $this->bankNum = $bankNum;

        return $this;
    }

    /**
     * Get bankNum
     *
     * @return string
     */
    public function getBankNum()
    {
        return $this->bankNum;
    }

    /**
     * Set qqNum
     *
     * @param string $qqNum
     *
     * @return UserProfile
     */
    public function setQqNum($qqNum)
    {
        $this->qqNum = $qqNum;

        return $this;
    }

    /**
     * Get qqNum
     *
     * @return string
     */
    public function getQqNum()
    {
        return $this->qqNum;
    }

    /**
     * Set createAt
     *
     * @param integer $createAt
     *
     * @return UserProfile
     */
    public function setCreateAt($createAt)
    {
        $this->createAt = $createAt;

        return $this;
    }

    /**
     * Get createAt
     *
     * @return integer
     */
    public function getCreateAt()
    {
        return $this->createAt;
    }

    /**
     * Set updateAt
     *
     * @param integer $updateAt
     *
     * @return UserProfile
     */
    public function setUpdateAt($updateAt)
    {
        $this->updateAt = $updateAt;

        return $this;
    }

    /**
     * Get updateAt
     *
     * @return integer
     */
    public function getUpdateAt()
    {
        return $this->updateAt;
    }

    /**
     * Set phoneNum
     *
     * @param string $phoneNum
     *
     * @return UserProfile
     */
    public function setPhoneNum($phoneNum)
    {
        $this->phoneNum = $phoneNum;

        return $this;
    }

    /**
     * Get phoneNum
     *
     * @return string
     */
    public function getPhoneNum()
    {
        return $this->phoneNum;
    }

    /**
     * Set userId
     *
     * @param \GamesBundle\Entity\User $userId
     *
     * @return UserProfile
     */
    public function setUserId(\GamesBundle\Entity\User $userId = null)
    {
        $this->userId = $userId;

        return $this;
    }

    /**
     * Get userId
     *
     * @return \GamesBundle\Entity\User
     */
    public function getUserId()
    {
        return $this->userId;
    }
}
